package ntest;

import androidx.appcompat.app.AppCompatActivity;

import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.example.hello_world.R;

public class test1_8 extends AppCompatActivity implements View.OnClickListener{


    private TextView textView;
    private Button button01,button02,button03;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_test1_8);
        textView=findViewById(R.id.id_18text);
        button01=findViewById(R.id.button01);
        button02=findViewById(R.id.button02);
        button03=findViewById(R.id.button03);
        button01.setOnClickListener(this);
        button02.setOnClickListener(this);
        button03.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.button01:
                textView.setTextColor(Color.YELLOW);
                break;
            case R.id.button02:
                textView.setTextColor(getResources().getColor(R.color.color02));
                break;
            case R.id.button03:
                textView.setTextColor(getResources().getColor(R.color.color03));
                break;
        }
    }
}